home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Games Machine 76
/
XENIATGM66.iso
/
Indiana Jones
/
Indiana Jones.exe
/
RESOURCE
/
PREVIEW.GOB
/
cog_olv_drainwater.cog
< prev
next >
Wrap
Text File
|
1999-11-15
|
16KB
|
648 lines
# Jones 3D Cog Script
#
# olv_drainwater.cog
#
# Cog to drain water from pool.
#
# [DS & revised by HB]
#
# (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
#
# ==============================================================================
symbols
message startup
message activated
message entered
message exited
message pulse
keyframe in_activate=in_activate_medium.key local
sound fallsnd=gen_waterfall_a.wav local
sound mouthstop=gen_stone_stop_c.wav local
sound blowsnd=olv_waterfall_blast_c.wav local
sound waterdrn=nub_bull_move1_c.wav local
sound underwtr=gen_underwater_a.wav local
sound hitstone=pru_boulder_crash_c.wav local
sound music0=mus_teo_statuerise.wav local
thing raingod nolink
thing mouth
thing fallpos nolink
thing splashpos
thing splashpos2
thing splashpos3
thing splashpos4
thing switch0
thing head0
thing rockcam nolink
thing campos1 nolink
thing camtarg nolink
thing switch_cam nolink
thing ghostsurf
thing surf local
thing waterfall local
thing fallsplash local
thing fallsplash2 local
surface watersurf0
surface watersurf1
surface watersurf2
surface watersurf3
surface watersurf4
surface watersurf5
surface watersurf6
surface watersurf7
surface watersurf8
surface headslot mask=0x080
surface climb0
surface climb1
surface climb2
sector pool0
sector pool1
sector pool2
sector pool3
sector pool4
sector pool5
sector pool6
sector pool7
sector pool8
sector pool9
sector pool0s
sector pool1s
sector pool2s
sector pool3s
sector pool4s
sector pool5s
sector pool6s
sector pool7s
sector pool8s
sector pool9s
sector pool0sm
sector pool1sm
sector pool2sm
sector pool3sm
sector pool4sm
sector pool5sm
sector pool6sm
sector pool7sm
sector pool8sm
sector pool9sm
sector pool0sn
sector pool1sn
sector pool2sn
cog bridgecog # send message to set bridge (olv_bridge_pad)
cog hints # send message when complete.
template watersurf=h2odrain local
template falltemp=waterfall local
template falltemplong=longwaterfall local
template splashtemp=fallfoam_3x5b local
vector waterlight local
vector drylight local
vector dryshade local
vector shademore local
flex fps=9.0 desc=playback_speed
int drained=0 local
int blocked=0 local
int blocked=0 local
int curcam local
int cnt0=0 local
int cnt1=0 local
int cntw local
int fallsound local
int vibe local
int shake local
# ........new anim stuff........
thing ghostpour
thing ghostspray
thing bridgelook
sector outfallsec0
sector outfallsec1
surface outerfall0
surface outerfall1
template waterpour
template waterspray
material animmat0=olv_a4sprite_pour.mat local
material animmat1=olv_a4sprite_spray.mat local
flex cameraview local
flex cameraend local
flex rockcamera local
int drainwtr local
int outfallsnd local
thing pouring local
thing spraying local
vector posoffset local
vector angoffset local
# ---- Head no-move stuff ---------
keyframe nopush=in_pushpull_anticipate.key local
thing player local
int on_top=0 local
int solved=0 local
int talkin local
sound nope=inxj098.wav local #It won't budge.
end
# ------------------------------------------------------------------------------
code
# ..............................................................................
startup:
sleep(0.01);
player = GetLocalPlayerThing();
SetThingLight(raingod, '0.5 0.5 0.4', 0.6, 0.01);
SetThingLight(mouth, '0.5 0.5 0.4', 0.6, 0.01);
waterlight = VectorSet(0.0, 0.6, 0.8);
drylight = VectorSet(0.4, 0.4, 0.3);
dryshade = VectorSet(0.2, 0.2, 0.1);
shademore = VectorSet(0.15, 0.15, 0.1);
waterfall = Creatething(falltemp, fallpos);
CaptureThing(waterfall);
fallsound = PlaySoundThing(fallsnd, fallpos, 1, 5, 25, 1);
fallsplash= Creatething(splashtemp, splashpos);
fallsplash2= Creatething(splashtemp, splashpos2);
CaptureThing(fallsplash);
CaptureThing(fallsplash2);
SetFaceGeoMode(outerfall0, 0);
SetFaceGeoMode(outerfall1, 0);
ClearSurfaceFlags(climb0, 0x2000); #Not Climbable.
ClearSurfaceFlags(climb1, 0x2000); #Not Climbable.
ClearSurfaceFlags(climb2, 0x2000); #Not Climbable.
for (cnt0 = 0; cnt0<=9; cnt0=cnt0+1)
{
SetSectorFlags(pool0[cnt0], 2);
SetSectorFlags(pool0s[cnt0], 2);
SetSectorFlags(pool0sm[cnt0], 2);
SectorSound(pool0[cnt0], underwtr, 1);
SectorSound(pool0s[cnt0], underwtr, 1);
SectorSound(pool0sm[cnt0], underwtr, 1);
}
for (cnt1 = 0; cnt1<=3; cnt1=cnt1+1)
{
SetSectorFlags(pool0sn[cnt1], 2);
SectorSound(pool0sn[cnt1], underwtr, 1);
}
return;
# ..............................................................................
activated:
if ((getsenderref() == head0) && (solved == 1))
{
if(on_top == 1) return;
on_top=1;
MakeMeStop();
DeselectWeaponWait(player);
StartCutscene(0);
PlayKey(player, nopush, 4, 0x12, 1);
talkin = PlayVoice(player, nope, 1.0, 1);
WaitForSound(talkin);
EndCutscene();
on_top=0;
ClearActorFlags(player, 0x200000);
return;
}
if (getsenderref() == switch0)
{
curcam = GetCurrentCamera();
MakeMeStop();
DeselectWeaponWait(player);
StartCutscene(1);
if (drained==0)
{
SendMessageEx(hints, user2, 1, 0, 0, 0); #param0=1; Water Drained.
SetExtCamOffsetToThing(switch_cam);
SetExtCamLookOffsetToThing(switch0);
PlayKey(player, in_activate, 4, 0x12, 0);
Movetoframe(switch0, 1, 1.0);
waitforstop(switch0);
drained=1;
for (cntw = 0; cntw<=8; cntw=cntw+1)
{
SetFaceGeoMode(watersurf0[cntw], 0);
}
SetAdjoinFlags(watersurf8, 2); #skullface.
for (cnt0 = 0; cnt0<=9; cnt0=cnt0+1)
{
ClearSectorFlags(pool0[cnt0], 2);
ClearSectorFlags(pool0s[cnt0], 2);
ClearSectorFlags(pool0sm[cnt0], 2);
SectorSound(pool0[cnt0], -1, 1);
SectorSound(pool0s[cnt0], -1, 1);
SectorSound(pool0sm[cnt0], -1, 1);
Setsectorlight(pool0[cnt0], drylight, .1);
Setsectorlight(pool0s[cnt0], dryshade, .1);
Setsectorlight(pool0sm[cnt0], shademore, .1);
}
for (cnt1 = 0; cnt1<=3; cnt1=cnt1+1)
{
ClearSectorFlags(pool0sn[cnt1], 2);
SectorSound(pool0sn[cnt1], -1, 1);
Setsectorlight(pool0sn[cnt1], shademore, .1);
}
call cameraview;
return;
}
else
{
SetExtCamOffsetToThing(switch_cam);
SetExtCamLookOffsetToThing(switch0);
PlayKey(Player, in_activate, 4, 0x12, 0);
Movetoframe(switch0, 1, 1.0);
waitforstop(switch0);
drained=0;
call cameraview;
return;
}
return;
}
# ..............................................................................
entered:
if (getsenderref() == head0)
{
on_top=1;
return;
}
if((getsenderref() == headslot) && (getsourceref() == head0))
{
blocked=1;
# print ("block in slot");
}
return;
# ..............................................................................
exited:
if (getsenderref() == head0)
{
on_top=0;
return;
}
if((getsenderref() == headslot) && (getsourceref() == head0))
{
blocked=0;
# print ("block removed from slot");
}
return;
# ..............................................................................
cameraview:
# Let's see what happened...
Sleep(1.0);
SetCameraLookInterp(2, 0);
SetCameraPosInterp(2, 0);
SetCameraFocus(2, campos1);
SetCameraSecondaryFocus(2, camtarg);
SetCurrentCamera(2);
SetCameraFOV(70, 0, 0.0);
if (drained == 1)
{
# Close Tlaloc's mouth...
Movetoframe(mouth, 1, 1.0);
# Pinch off waterfall...
ThingFadeAnim(waterfall, 1.0, 0.0, 1.0, 0);
Sleep(1.0);
Destroything(waterfall);
StopSound(fallsound, 0);
Destroything(fallsplash);
Destroything(fallsplash2);
SetSurfaceFlags(climb0, 0x2000); #Climbable.
SetSurfaceFlags(climb1, 0x2000); #Climbable.
SetSurfaceFlags(climb2, 0x2000); #Climbable.
}
else
{
if (blocked == 1)
{
PlaySoundLocal(music0, 1.0, 0.0, 0x0, 0);
}
Movetoframe(mouth, 0, 1.0);
waterfall = Creatething(falltemplong, fallpos);
CaptureThing(waterfall);
SetThingAlpha(waterfall, 0.0);
ThingFadeAnim(waterfall, 0.0, 1.0, 1.0, 0);
fallsound = PlaySoundThing(fallsnd, fallpos, 1, 5, 25, 1);
ClearSurfaceFlags(climb0, 0x2000); #Not Climbable.
ClearSurfaceFlags(climb1, 0x2000); #Not Climbable.
ClearSurfaceFlags(climb2, 0x2000); #Not Climbable.
}
WaitForStop(mouth);
PlaySoundThing(mouthstop, mouth, 1, 5, 10, 0);
Sleep(1.0);
MoveToFrame(camtarg, 1, 3.87);
MoveToFrame(campos1, 1, 3.0);
SetCameraFOV(60, 1, 4);
# Let's handle the water...
# print ("oh thats what it does");
if (drained == 1)
{
# Water draining...
surf = Creatething(watersurf, ghostsurf);
capturething(surf);
SetThingLight(surf, '0.0 0.3 0.4', 0.6, 0.01);
SetCollideType(surf, 0);
# print ("water going to empty");
Movetoframe(surf, 1, 0.5);
drainwtr = PlaySoundLocal(waterdrn, 1.0, 0.0, 1, 0);
# PlaySoundThing(waterdrn, surf, 1.0, 15, 45, 1);
WaitForStop(surf);
StopSound(drainwtr, 0);
DestroyThing(surf);
call cameraend;
}
else
{
# Water filling...
fallsplash= Creatething(splashtemp, splashpos3);
fallsplash2= Creatething(splashtemp, splashpos4);
CaptureThing(fallsplash);
CaptureThing(fallsplash2);
surf = Creatething(watersurf, ghostsurf);
capturething(surf);
# AttachThingToThing(fallsplash, surf);
# AttachThingToThing(fallsplash2, surf);
SetThingLight(surf, '0.0 0.3 0.4', 0.6, 0.01);
SetCollideType(surf, 0);
# print ("water going to fill");
Jumptoframe(surf, 1, pool0);
Movetoframe(surf, 0, 0.5);
drainwtr = PlaySoundLocal(waterdrn, 1.0, 0.0, 1, 0);
# PlaySoundThing(waterdrn, surf, 1.0, 15, 45, 1);
WaitForStop(surf);
StopSound(drainwtr, 0);
DestroyThing(surf);
DestroyThing(fallsplash);
DestroyThing(fallsplash2);
fallsplash= Creatething(splashtemp, splashpos);
fallsplash2= Creatething(splashtemp, splashpos2);
CaptureThing(fallsplash);
CaptureThing(fallsplash2);
for (cntw = 0; cntw<=8; cntw=cntw+1)
{
SetFaceGeoMode(watersurf0[cntw], 4);
}
ClearAdjoinFlags(watersurf8, 2); # skullface
for (cnt0 = 0; cnt0<=9; cnt0=cnt0+1)
{
SetSectorFlags(pool0[cnt0], 2);
SetSectorFlags(pool0s[cnt0], 2);
SetSectorFlags(pool0sm[cnt0], 2);
SectorSound(pool0[cnt0], underwtr, 1);
SectorSound(pool0s[cnt0], underwtr, 1);
SectorSound(pool0sm[cnt0], underwtr, 1);
Setsectorlight(pool0[cnt0], waterlight, .1);
Setsectorlight(pool0s[cnt0], waterlight, .1);
Setsectorlight(pool0sm[cnt0], waterlight, .1);
}
for (cnt1 = 0; cnt1<=3; cnt1=cnt1+1)
{
SetSectorFlags(pool0sn[cnt1], 2);
SectorSound(pool0sn[cnt1], underwtr, 1);
Setsectorlight(pool0sn[cnt1], waterlight, .1);
}
if (blocked == 1)
{
blocked=0;
call rockcamera; # was goto
return;
}
DestroyThing(waterfall);
waterfall = Creatething(falltemp, fallpos);
CaptureThing(waterfall);
call cameraend;
}
return;
# ..............................................................................
cameraend:
ResetCameraFOV(0, 0.0);
SetCurrentCamera(curcam);
ClearActorFlags(Player, 0x200000);
Movetoframe(switch0, 0, 1.0);
RestoreExtCam();
EndCutscene();
MoveToFrame(camtarg, 0, 10);
MoveToFrame(campos1, 0, 10);
return;
# ..............................................................................
rockcamera:
# Let's look outside now...
SetFaceGeoMode(outerfall0, 4);
SetFaceGeoMode(outerfall1, 4);
Setsectorlight(outfallsec0, waterlight, .1);
Setsectorlight(outfallsec1, waterlight, .1);
outfallsnd = PlaySoundThing(fallsnd, ghostpour, 1, 5, 25, 1);
SetCameraLookInterp(2, 0);
SetCameraPosInterp(2, 0);
SetCameraFocus(2, rockcam);
SetCameraSecondaryFocus(2, head0);
SetCurrentCamera(2);
CaptureThing(head0);
PlaySoundThing(blowsnd, head0, 1, 30, 50, 0);
SetCameraFOV(20, 0, 0);
Sleep(0.01);
SetCameraFOV(45, 1, 1.5);
pouring = CreateThing(waterpour, ghostpour);
spraying = CreateThing(waterspray, ghostspray);
materialanim(animmat0, fps, 0);
materialanim(animmat1, fps, 0);
MoveToFrame(head0, 1, 0);
MoveToFrame(head0, 2, 10);
WaitForStop(head0);
PlaySoundLocal(hitstone, 1.0, 0.0, 0, 0);
# Need to make head non-pushable.
solved=1;
ClearThingFlags(head0, 0x40000000);
shake = 3;
SetPulse(0.1);
Sleep(0.5);
shake = 2;
Sleep(0.5);
SetPulse(0.0);
DestroyThing(pouring);
DestroyThing(spraying);
SendMessage(bridgecog, user1);
SendMessageEx(hints, user2, 2, 0, 0, 0); #param0=2; Rock head valley.
Sleep(0.2);
SetCameraFOV(60, 1, 2.0);
SetCameraLookInterp(2, 1);
SetCameraInterpSpeed(2, 2.0);
Sleep(0.1);
SetCameraSecondaryFocus(2, bridgelook);
Sleep(5.0);
SetCameraLookInterp(2, 0); # reset default
SetCameraInterpSpeed(2, 1.0); # reset default
SetFaceGeoMode(outerfall0, 0);
SetFaceGeoMode(outerfall1, 0);
Setsectorlight(outfallsec0, drylight, .1);
Setsectorlight(outfallsec1, drylight, .1);
stopsound(outfallsnd, 0);
call cameraend;
return;
# ..............................................................................
pulse:
vibe = RandBetween(1, 4);
if (vibe == 1)
{
if (shake == 1)
{
posOffset = '-0.005 0.00 -0.001'; #1 was .005x
angOffset = '0.00 -0.001 0.001';
}
if (shake == 2)
{
posOffset = '0.01 -0.01 0.005'; #2
angOffset = '0.005 0.00 -0.005';
}
if (shake == 3)
{
posOffset = '0.01 0.02 -0.02'; #3
angOffset = '-0.01 0.01 -0.01';
}
}
if (vibe == 2)
{
if (shake == 1)
{
posOffset = '0.005 -0.002 0.001'; #2 was .005x
angOffset = '0.001 0.00 -0.001';
}
if (shake == 2)
{
posOffset = '0.005 0.01 -0.01'; #3
angOffset = '-0.005 0.005 -0.00';
}
if (shake == 3)
{
posOffset = '-0.02 0.00 0.02'; #4 was .01x
angOffset = '0.00 0.00 0.01';
}
}
if (vibe == 3)
{
if (shake == 1)
{
posOffset = '0.002 0.002 -0.002'; #3 was .002x
angOffset = '-0.001 0.002 -0.002';
}
if (shake == 2)
{
posOffset = '-0.015 0.00 0.01'; #4 was .01x
angOffset = '0.00 0.00 0.01';
}
if (shake == 3)
{
posOffset = '-0.025 0.00 -0.01'; #1 was .02x
angOffset = '0.00 -0.01 0.01';
}
}
if (vibe == 4)
{
if (shake == 1)
{
posOffset = '-0.001 0.00 0.002'; #4
angOffset = '0.00 0.00 0.001';
}
if (shake == 2)
{
posOffset = '-0.01 0.00 -0.005'; #1
angOffset = '0.00 -0.005 0.005';
}
if (shake == 3)
{
posOffset = '0.02 -0.02 0.01'; #2
angOffset = '0.01 0.00 -0.01';
}
}
vibe = RandBetween(1, 3);
if (vibe == 1)
{
SetPulse(0.05);
}
if (vibe == 2)
{
SetPulse(0.1);
}
if (vibe == 3)
{
SetPulse(0.15);
}
SetPOVShake(posOffSet, angOffSet, 200.0, 200.0);
return;
end